import struct

data = 0x0E << 8 | 0x0F
# print(int(data))

buffer = b'\x0E\x0F'
psi = struct.unpack('bb',buffer[0:2])
psi = psi[0] << 8 | psi[1]
psi = psi/10.0
print(psi)

buffer = b'\x0F\xFF'
# pit = struct.unpack('bb', buffer[0:2])
pit = buffer[0] << 8 | buffer[1]
pit = int(pit*156/4095-78)
print(pit)

buffer = b'\x0F\xFF\x0F\xFF'
bits_1 = buffer[0] & 0x80 != 0
print(bits_1)

buffer = b'\x8F\xFF\x00\x80'
mutable_buffer = bytearray(buffer)
mutable_buffer[3] &= 0x7F  # 清除最高位
lat = mutable_buffer[3] << 24 | mutable_buffer[2] << 16 | mutable_buffer[1] << 8 | mutable_buffer[0]
lat = lat/1000.0
print(lat)

arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
slice1 = arr[2-1:4-1]
print(slice1)
